package com.music.service.playlists.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Required;

import com.music.service.playlists.beans.Playlist;
import com.music.service.playlists.dao.PlaylistDAO;

public class PlaylistServiceImpl implements PlaylistService {
	private PlaylistDAO mPlaylistDAO;

	
	/**
	 * @return PlaylistDAO
	 */
	public PlaylistDAO getPlaylistDAO() {
		return mPlaylistDAO;
	}

	/**
	 * @param pPlaylistDAO
	 */
	@Required
	public void setPlaylistDAO(PlaylistDAO pPlaylistDAO) {
		mPlaylistDAO = pPlaylistDAO;
	}

	@Override
	public boolean addPlaylist(Long pMemberId, String pPlaylistName) {
		return getPlaylistDAO().addPlaylist(pMemberId, pPlaylistName);	
	}

	@Override
	public boolean addSongToPlaylist(Long pPlaylistId, Long pSongId,int pSongPosition) {
		return getPlaylistDAO().addSongToPlaylist(pPlaylistId, pSongId, pSongPosition);
	}

	@Override
	public boolean deletePlaylist(Long pMemberId, Long pPlaylistId) {
		return getPlaylistDAO().deletePlaylist(pMemberId, pPlaylistId);
	}

	@Override
	public boolean deleteSongFromPlaylist(Long pPlaylistId, Long pSongId) {
		return getPlaylistDAO().deleteSongFromPlaylist(pPlaylistId, pSongId);
	}

	@Override
	public List<Playlist> viewPlaylists(Long pMemberId) {
		return getPlaylistDAO().viewPlaylists(pMemberId);
	}

	@Override
	public List<Playlist> getRecentPlaylists(Long pMemberId, int pSize) {
		return getPlaylistDAO().getRecentPlaylists(pMemberId, pSize);
	}

	@Override
	public Playlist getPlaylistInfoForMember(Long pMemberId, Long pPlaylistId) {
		return getPlaylistDAO().getPlaylistInfoForMember(pMemberId, pPlaylistId);
	}

		
}
